<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>演示申请</title>
<script src="echart/jquery-1.9.1.min.js"></script>
<style type="text/css">
.elegant-aero {
	margin-left:auto;
	margin-right:auto;
	max-width: 500px;
	background: #D2E9FF;
	padding: 20px 20px 20px 20px;
	font: 12px Arial, Helvetica, sans-serif;
	color: #666;
}
.elegant-aero h1 {
	font: 24px "Trebuchet MS", Arial, Helvetica, sans-serif;
	padding: 10px 10px 10px 20px;
	display: block;
	background: #C0E1FF;
	border-bottom: 1px solid #B8DDFF;
	margin: -20px -20px 15px;
	font-weight: bold;
}
.elegant-aero h1>span {
display: block;
font-size: 11px;
}

.elegant-aero label>span {
float: left;
margin-top: 10px;
color: #5E5E5E;
}
.elegant-aero label {
display: block;
margin: 0px 0px 5px;
}
.elegant-aero label>span {
float: left;
width: 20%;
text-align: right;
padding-right: 15px;
margin-top: 10px;
font-weight: bold;
}
.elegant-aero input[type="text"], .elegant-aero input[type="email"], .elegant-aero textarea, .elegant-aero select {
color: #888;
width: 70%;
padding: 0px 0px 0px 5px;
border: 1px solid #C5E2FF;
background: #FBFBFB;
outline: 0;
-webkit-box-shadow:inset 0px 1px 6px #ECF3F5;
box-shadow: inset 0px 1px 6px #ECF3F5;
font: 200 12px/25px Arial, Helvetica, sans-serif;
height: 30px;
line-height:15px;
margin: 2px 6px 16px 0px;
}
.elegant-aero textarea{
height:100px;
padding: 5px 0px 0px 5px;
width: 70%;
}
.elegant-aero select {
background: #fbfbfb url('down-arrow.png') no-repeat right;
background: #fbfbfb url('down-arrow.png') no-repeat right;
appearance:none;
-webkit-appearance:none;
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
width: 70%;
}
.elegant-aero .button{
padding: 10px 30px 10px 30px;
background: #66C1E4;
border: none;
color: #FFF;
box-shadow: 1px 1px 1px #4C6E91;
-webkit-box-shadow: 1px 1px 1px #4C6E91;
-moz-box-shadow: 1px 1px 1px #4C6E91;
text-shadow: 1px 1px 1px #5079A3;

}
.elegant-aero .button:hover{
background: #3EB1DD;
}
</style>


</head>
<body>
<form  action="ShowApply" method="POST" class="elegant-aero">
<h1>演示申请
<span>请认真填写以下信息</span>
</h1>
<label>
<span>医院:</span>
<input name="hospital" type="text" placeholder="请输入演示医院"/>
</label>
<label>
<span>联系人:</span>
<input name="connecter" type="text" placeholder="请输入医院联系人"/>
</label>
<label>
<span>联系手机:</span>
<input name="conmobile" type="text" placeholder="请输入医院联系人手机号"/>
</label>
<label>
<span>演示人:</span>
<input name="shower" type="text" placeholder="请输入演示人员姓名"/>
</label>
<label>
<span>演示手机:</span>
<input name="shomobile" type="text" placeholder="请输入演示人员手机号"/>
</label>
<label>
<span>验证码:</span>
<input name="vcode" type="text" placeholder="请输入验证码"/>
</label>
<label>
<span>&nbsp;</span>
<input type="button"  class="button" value="获取验证码" onclick="getvcode();">
<input type="button" class="button" value="提交申请" onclick="apply();"/>
</label>
</form>
<script type="text/javascript">
function getvcode(){
	var mobile = $("input[name='shomobile']").val();
	if(mobile==null||mobile==''){
		alert("请输入手机号");
		return;
	}
	if(mobile.length!=11){
		alert("请输入正确的手机号");
		return;
	}
	$.post("Vcode",
			{
				mobile:mobile
			}
			,function(data,status){
		        if(status=='success'){
		        	if(data=='success'){
		        		alert("已发送验证码，请注意查收");
		        	}else{
		        		alert("发送错误，请重试");
		        	}
		        }
    });
	
}
function apply(){
	if($("input[name='hospital']").val()==null){
		alert("请填写演示医院");
		return;
	}
	if($("input[name='shower']").val()==null){
		alert("请填写演示人员姓名");
		return;
	}
	if($("input[name='shomobile']").val()==null){
		alert("请填写演示人员手机号");
		return;
	}
	if($("input[name='shomobile']").val().length!=11){
		alert("请填写正确的演示人员手机号");
		return;
	}
	if($("input[name='vcode']").val()==null){
		alert("请填写验证码");
		return;
	}
	$("form").submit();
}
</script>
</body>
</html>